<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
   xmlns:h="http://java.sun.com/jsf/html"
   xmlns:ui="http://java.sun.com/jsf/facelets"
   xmlns:p="http://primefaces.org/ui">
 
    <ui:composition template="structpage/templates/defaultLayout.xhtml">
    <ui:define name="title">
        <h:outputText value="ChequeTeatinos - Carrito"/>
    </ui:define>
    <ui:define name="content"> 
    
    <h:head>
        <title><h:outputText value="#{msg.cart}"/></title>
    </h:head>
    <h:body>
        <h3><h:outputText value="#{msg.yourshopping}"/></h3>
        <h:form>
           <p:panel id="panel" style="none">  
                <p:messages id="messages" />
                <p:dataTable id="company" var="offer" value="#{cartBean.ofertasCart}">
                    <p:column headerText="#{msg.delete}">
                        <h:commandButton value="#{msg.delete}" action="#{cartBean.deleteOffer(offer)}" image="resources/media/images/delete.png"/>
                    </p:column>
                    <p:column headerText="#{msg.offer}">
                        #{offer.nombre}                    
                    </p:column>    
                    <p:column headerText="#{msg.company}">
                        #{offer.empresa}                    
                    </p:column>                    
                    <p:column headerText="#{msg.price}" footerText="Total: #{cartBean.preciototal}€">
                        #{offer.precio}                    
                    </p:column>
                    <p:column headerText="#{msg.amount}">
                        #{offer.unidades}                    
                    </p:column>
                    
                </p:dataTable>  
                
                <h4><h:outputText value="#{msg.payment}"/></h4>
                <h:panelGroup>
                    <p>
                        <h:panelGroup layout="block">
                            IBAN
                        </h:panelGroup>
                        <h:form>
                            <p:inputText value="ES 70 0128 0001 01 0123456789" disabled="true" />
                        </h:form>
                    </p>

                </h:panelGroup>        
                <br /><br />
                
                <p:commandButton rendered="#{loginBean.logged==1}" value="#{msg.end}" action="#{cartBean.payfinish()}" />
                
            </p:panel>
            
            
        </h:form>
        
    </h:body>
    </ui:define>
    </ui:composition>
</html>

